/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CoreClnjjl extends BasicModel<CoreClnjjl> {
  clnjjlCph?: string; // 车牌号
  clnjjlPpxh?: string; // 品牌型号
  clnjjlClsbdm?: string; // 车辆识别代码
  clnjjlFdjhm?: string; // 发动机号码
  clnjjlNjrq?: string; // 年检日期
  clnjjlSjr?: string; // 送检人
  clnjjlDlr?: string; // 代理人
  clnjjlNjyxq?: string; // 年检有效期
  clnjjlNjfy?: number; // 年检费用
  createByName?: string; // 创建人
  updateByName?: string; // 修改人
}

export const coreClnjjlList = (params?: CoreClnjjl | any) =>
  defHttp.get<CoreClnjjl>({ url: adminPath + '/cardd/njjl/coreClnjjl/list', params });

export const coreClnjjlListData = (params?: CoreClnjjl | any) =>
  defHttp.post<Page<CoreClnjjl>>({ url: adminPath + '/cardd/njjl/coreClnjjl/listData', params });

export const coreClnjjlForm = (params?: CoreClnjjl | any) =>
  defHttp.get<CoreClnjjl>({ url: adminPath + '/cardd/njjl/coreClnjjl/form', params });

export const coreClnjjlSave = (params?: any, data?: CoreClnjjl | any) =>
  defHttp.postJson<CoreClnjjl>({ url: adminPath + '/cardd/njjl/coreClnjjl/save', params, data });

export const coreClnjjlImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/njjl/coreClnjjl/importData',
      onUploadProgress,
    },
    params,
  );

export const coreClnjjlDelete = (params?: CoreClnjjl | any) =>
  defHttp.get<CoreClnjjl>({ url: adminPath + '/cardd/njjl/coreClnjjl/delete', params });
